package com.yfs.cloud.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
* @Company: 影法師工作室
* @Description: 业务属性配置类, 属性较多的时候拒绝 @Value 注入, 那样东一点西一点, 很乱, 这里搞一个集中配置业务属性配置类
* @author 影法師  
* @date 2020年8月26日 下午2:36:29 
* @version V1.0
 */
@Component
@ConfigurationProperties(prefix = "com.yfs.cloud")
public class BusinessProperties {

	private JwtProperties jwt = new JwtProperties();

	private SmsProperties sms = new SmsProperties();

	private WxLoginProperties wxlogin = new WxLoginProperties();

	public JwtProperties getJwt() {
		return jwt;
	}

	public void setJwt(JwtProperties jwt) {
		this.jwt = jwt;
	}

	public SmsProperties getSms() {
		return sms;
	}

	public void setSms(SmsProperties sms) {
		this.sms = sms;
	}

	public WxLoginProperties getWxlogin() {
		return wxlogin;
	}

	public void setWxlogin(WxLoginProperties wxlogin) {
		this.wxlogin = wxlogin;
	}

	/**
	* @Company: 影法師工作室
	* @Description: jwt 相关属性配置 
	* @author 影法師  
	* @date 2020年8月26日 下午1:58:35 
	* @version V1.0
	 */
	public class JwtProperties {
		/**jwt secret(万不可泄露!)*/
		private String secret;

		/**jwt 失效时间(单位是毫秒)*/
		private Long expire;

		public String getSecret() {
			return secret;
		}

		public void setSecret(String secret) {
			this.secret = secret;
		}

		public Long getExpire() {
			return expire;
		}

		public void setExpire(Long expire) {
			this.expire = expire;
		}

	}

	/**
	* @Company: 影法師工作室
	* @Description: 手机验证码 
	* @author 影法師  
	* @date 2020年8月29日 下午9:54:52 
	* @version V1.0
	 */
	public class SmsProperties {

		private String domain;

		private String version;

		private String action;

		/**地域节点id*/
		private String regionId;

		/**key*/
		private String accessKeyId;

		/**secret*/
		private String secret;

		/**阿里云短信服务签名名称*/
		private String signName;

		/**阿里云短信模板code*/
		private String templateCode;

		/**短信验证码失效时间*/
		private Long expire;

		public String getDomain() {
			return domain;
		}

		public void setDomain(String domain) {
			this.domain = domain;
		}

		public String getVersion() {
			return version;
		}

		public void setVersion(String version) {
			this.version = version;
		}

		public String getAction() {
			return action;
		}

		public void setAction(String action) {
			this.action = action;
		}

		public String getRegionId() {
			return regionId;
		}

		public void setRegionId(String regionId) {
			this.regionId = regionId;
		}

		public String getAccessKeyId() {
			return accessKeyId;
		}

		public void setAccessKeyId(String accessKeyId) {
			this.accessKeyId = accessKeyId;
		}

		public String getSecret() {
			return secret;
		}

		public void setSecret(String secret) {
			this.secret = secret;
		}

		public String getSignName() {
			return signName;
		}

		public void setSignName(String signName) {
			this.signName = signName;
		}

		public String getTemplateCode() {
			return templateCode;
		}

		public void setTemplateCode(String templateCode) {
			this.templateCode = templateCode;
		}

		public Long getExpire() {
			return expire;
		}

		public void setExpire(Long expire) {
			this.expire = expire;
		}

	}

	/**
	* @Company: 影法師工作室
	* @Description: 微信扫码登录配置 
	* @author 影法師  
	* @date 2020年8月30日 上午10:24:21 
	* @version V1.0
	 */
	public class WxLoginProperties {

		private String appId;

		private String appsecret;

		private String redirectUrl;

		public String getAppId() {
			return appId;
		}

		public void setAppId(String appId) {
			this.appId = appId;
		}

		public String getAppsecret() {
			return appsecret;
		}

		public void setAppsecret(String appsecret) {
			this.appsecret = appsecret;
		}

		public String getRedirectUrl() {
			return redirectUrl;
		}

		public void setRedirectUrl(String redirectUrl) {
			this.redirectUrl = redirectUrl;
		}

	}
}
